#include "golf.h"
#include <iostream>
#include <string>
using namespace std;

void setgolf(golf &g, const char *name, int hc)
{
	g.fullname = name;
	g.handicap = hc;
}

void setgolf(golf &g)
{
	cout << "please input the information of the player: " << endl;

	cout << "input the name :_\b " ;
	getline(cin, g.fullname);

	cout << "input the handicap:_\b" ;
	while (!(cin >> g.handicap))  //bad input
	{
		cin.clear();
		while (cin.get() != '\n')
			continue;
		cout << "bad input, please enter again.";
		cout << "input the handicap:_\b" ;
	}

}

void handicap(golf &g, int hc)
{
	g.handicap = hc;
}

void showgolf(const golf &g)
{
	cout << "name : " << g.fullname << "   handicap : " << g.handicap << endl;
}